<template>
  <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">
    <el-row :gutter="15">
      <el-col :span="4">
        <el-form-item label="所属单位：">
          <el-select v-model="formData.ssdw" clearable :style="{width: '100%'}">
            <el-option
              v-for="(item, index) in CompanyList"
              :key="index"
              :label="item.name"
              :value="item.code"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="4">
        <el-form-item label="维护班组：">
          <el-select v-model="formData.whbz" clearable :style="{width: '100%'}">
            <el-option
              v-for="(item, index) in TeamList"
              :key="index"
              :label="item.name"
              :value="item.code"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="4">
        <el-form-item label="电压等级：">
          <el-select v-model="formData.dydj" clearable :style="{width: '100%'}">
            <el-option
              v-for="(item, index) in VoltageList"
              :key="index"
              :label="item.name"
              :value="item.code"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="4">
        <el-form-item label="变电站：">
          <el-select v-model="formData.bdz" clearable filterable :style="{width: '100%'}">
            <el-option
              v-for="(item, index) in bdz"
              :key="index"
              :label="item.name"
              :value="item.code"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <!-- <el-col :span="4">
        <el-form-item label="间隔单元：" prop="station">
          <el-input v-model="formData.station" clearable :style="{width: '100%'}"></el-input>
        </el-form-item>
      </el-col>-->
      <el-col :span="4">
        <el-form-item label="设备名称：" prop="station">
          <el-input v-model="formData.sbmc" clearable :style="{width: '100%'}"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="4">
        <el-form-item label="当前状态：">
          <el-select v-model="formData.sfbj" clearable :style="{width: '100%'}">
            <el-option
              v-for="(item, index) in dqzt"
              :key="index"
              :label="item.name"
              :value="item.code"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="4" :offset="20" class="endbox">
        <el-button type="primary" @click="handel">查询</el-button>
        <el-button type="primary" @click="reset">重置</el-button>
      </el-col>
    </el-row>
  </el-form>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { publicAPIModule } from "@/store/modules/public";
@Component
export default class extends Vue {
  formData: any = {
    ssdw: "",
    whbz: "",
    dydj: "",
    bdz: "",
    sbmc: "",
    sfbj: "",
  };
  rules = {};
  get TeamList() {
    return publicAPIModule.TeamList;
  }
  get CompanyList() {
    return publicAPIModule.CompanyList;
  }
  get VoltageList() {
    return publicAPIModule.VoltageList;
  }
  get bdz (){
    return publicAPIModule.SubstationList
  } 
  dqzt = [
    {name:'全部',code:''},
    {name:'正常',code:'0'},
    {name:'异常',code:'1'}
  ];
  // query() {
  //   (this as any).$services
  //     .queryHasDataStations({})
  //     .then((result: any) => {
  //       console.log(result);

  //       this.bdz = result.data || [];
  //     })
  //     .catch((err: object) => {
  //       console.log(err);
  //     });
  // }
  handel() {
    this.$emit("formSearch");
  }
  reset() {
    this.formData = {};
  }
  mounted() {
    this.formData.sfbj=this.$route.query.id +''
    // this.query();
    this.handel();
    
  }
}
</script>

<style lang="scss" scoped>
</style>

